<?php
include('includes/connect.php');
if($_POST['subcat'])
{
$subcat=$_POST['subcat'];
$sql=mysql_query("SELECT * FROM expert_category AS s, expert_subcategory AS c WHERE c.expert_category_id = s.expert_category_id and s.expert_category_id =".$subcat);

while($row=mysql_fetch_array($sql))
{
$sid=$row['expert_subcategory_id'];
$data=$row['expert_subcategory'];
echo '<option value="'.$sid.'">'.$data.'</option>';

}
}

?>